const path = require('path')
const webpack = require('webpack')
const { merge } = require('webpack-merge')
const baseConfig = require('./webpack.common.js')

module.exports = merge(baseConfig, {
    mode: 'development',
    devtool: 'cheap-module-eval-source-map',
    devServer: {
        clientLogLevel: 'warning',//日志级别
        hot: true,
        open: true,
        publicPath: '/', // 页面的访问的根
    },

    module: {
        rules: [
            {
                //css文件处理
                test: /\.css?$/,
                //执行顺序从右到左
                use: ['vue-style-loader', 'css-loader']
            }
        ]
    },

    plugins: [
        //热更新
        new webpack.HotModuleReplacementPlugin()
    ]
})